package com.chen.winnerframework.domain.dto.notice;

import cn.hutool.core.bean.BeanUtil;
import com.chen.winnerframework.domain.entity.mybatis.Notice;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**通知公告 数据传输对象
 * @author chengy
 * @date 2022/11/25
 */
public class NoticeDto {

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    @ApiModelProperty(value = "标题", required = true)
    private String title;

    /**
     * 内容
     */
    @ApiModelProperty("内容")
    private String content;

    /**
     * 类型（0通知 1公告）
     */
    @NotNull(message = "类型不能为空")
    @ApiModelProperty(value = "类型（0通知 1公告）", required = true)
    private Integer type;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Notice toDo() {
        return BeanUtil.toBean(this, Notice.class);
    }

}
